#include <stdio.h>
int main(void)
{
    char c;
    int cn_1 = 0;
    int cn_2 = 0;

    while ((c = getchar()) != '#')
    {
        switch (c)
        {
            case '.' : putchar('!');
                       cn_1++;
                       break;
            case '!' : putchar('!');
                       putchar('!');
                       cn_2++;
                       break;
            default  : putchar(c);
        }
    }
    putchar('\n');
    printf("%d replacement(s) of . with !\n", cn_1);
    printf("%d replacement(s) of ! with !\n", cn_2);
    
    return 0;
}